FROM dockerhub.ygsoft.com:5000/elasticsearch:5.1.1
MAINTAINER xwh@ygsoft.com

# Export HTTP & Transport
EXPOSE 9200 9300

# Volume for Elasticsearch data
VOLUME ["/usr/share/elasticsearch/data"]

# Copy configuration
COPY config /usr/share/elasticsearch/config

# Copy run script
COPY run.sh /
RUN chmod +x /run.sh

# Set environment variables defaults
ENV ES_JAVA_OPTS "-Xms128m -Xmx512m"
ENV CLUSTER_NAME elasticsearch-default
ENV NODE_MASTER true
ENV NODE_DATA true
ENV NODE_INGEST true
ENV HTTP_ENABLE true
ENV NETWORK_HOST _site_
ENV HTTP_CORS_ENABLE true
ENV HTTP_CORS_ALLOW_ORIGIN *
ENV NUMBER_OF_MASTERS 1
ENV NUMBER_OF_SHARDS 1
ENV NUMBER_OF_REPLICAS 0

CMD ["/run.sh"]
